package router

import (
	"github.com/gin-gonic/gin"
	jwt "github.com/golangblogs/gojwt"
)

func LoadRouter(engine *gin.Engine) {
	user := engine.Group("/user")
	{
		user.POST("/login", Login)
		user.POST("/upload", Upload)
	}
	product := engine.Group("/product")
	{

		product.Use(jwt.JWTAuth("2209a"))
		product.POST("/list", ProductList)
		product.POST("/settlement/add", SettlementAdd)
		product.POST("/order/add", OrderAdd)
		product.POST("/order/list", GetOrderList)
		product.POST("/coupon/list", CouPonList)
		product.POST("/coupon/add", CouPonAdd)
		product.POST("/mycoupons/list", MyCouponList)
	}
	engine.POST("/pay/call", PayCall)
}
